//
//  DisplayScroll.m
//  AffectionBee
//
//  Created by 李通 on 16/8/20.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "DisplayScroll.h"

#define kMyHeight (self.frame.size.height)

@interface DisplayScroll ()

@end

@implementation DisplayScroll

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        [self setContentControl];
    }
    return self;
}

- (void)setContentControl {
    
    for (int i = 0; i < kPageCount + 1; i++) {
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenSize.width * i, 0, kScreenSize.width, kMyHeight)];
        [self addSubview:imageView];
    }
    self.contentSize = CGSizeMake(kScreenSize.width * (kPageCount + 2), kMyHeight);
    self.pagingEnabled = YES;
    self.bounces = NO;
    self.showsHorizontalScrollIndicator = NO;
    self.contentOffset = CGPointMake(kScreenSize.width, 0);
}


@end
